﻿using uTrade.Core;

namespace uTrade.Strategies
{
    internal class NewStrategy : Strategy
    {
        [Parameter("交易参数", "下单手数")]
        private int Lots = 5;

        private MACD macd;

        public override void Initialize()
        {
            macd = this.MACD(this.Close, 13, 26, 9);
        }

        private Tick last = null;

        public override void OnBarUpdate()
        {
            var macd_0 = this.MACD(this.Close, 13, 26, 9);
            if (macd_0.Diff[0].ApproxCompare(macd.Diff[0]) > 0)
                return;
            if (this.Tick.UpdateTime.IndexOf("14:30:00") > 0)
                last = (Tick)this.Tick.Clone();
        }
    }
}